import request from '@/config/axios'

// 项目需求与交付物关联表单 VO
export interface RequireDeliverableAssociationVO {
  id: number // 自增主键
  requirementId: string // 关联需求编号
  deliverableId: string // 关联交付物编号
  associationTime: Date // 需求与交付物关联时间
  associationDescription: string // 需求与交付物关联说明
}

// 项目需求与交付物关联表单 API
export const RequireDeliverableAssociationApi = {
  // 查询项目需求与交付物关联表单分页
  getRequireDeliverableAssociationPage: async (params: any) => {
    return await request.get({ url: `/project/require-deliverable-association/page`, params })
  },

  // 查询项目需求与交付物关联表单详情
  getRequireDeliverableAssociation: async (id: number) => {
    return await request.get({ url: `/project/require-deliverable-association/get?id=` + id })
  },

  // 新增项目需求与交付物关联表单
  createRequireDeliverableAssociation: async (data: RequireDeliverableAssociationVO) => {
    return await request.post({ url: `/project/require-deliverable-association/create`, data })
  },

  // 修改项目需求与交付物关联表单
  updateRequireDeliverableAssociation: async (data: RequireDeliverableAssociationVO) => {
    return await request.put({ url: `/project/require-deliverable-association/update`, data })
  },

  // 删除项目需求与交付物关联表单
  deleteRequireDeliverableAssociation: async (id: number) => {
    return await request.delete({ url: `/project/require-deliverable-association/delete?id=` + id })
  },

  // 导出项目需求与交付物关联表单 Excel
  exportRequireDeliverableAssociation: async (params) => {
    return await request.download({ url: `/project/require-deliverable-association/export-excel`, params })
  },
}